home *** CD-ROM | disk | FTP | other *** search
- unit GraphWin;
-
-
- interface
-
- uses
- Borland.Delphi.SysUtils,
- Borland.Win32.Windows,
- Borland.Win32.Messages,
- Borland.Delphi.Classes,
- Borland.Vcl.Graphics,
- Borland.Vcl.Controls,
- Borland.Vcl.Forms,
- Borland.Vcl.Dialogs,
- Borland.Vcl.Buttons,
- Borland.Vcl.ExtCtrls,
- Borland.Vcl.StdCtrls,
- Borland.Vcl.Menus;
-
- type
- TDrawingTool = (dtLine, dtRectangle, dtEllipse, dtRoundRect);
- TForm1 = class(TForm)
- Panel1: TPanel;
- LineButton: TSpeedButton;
- RectangleButton: TSpeedButton;
- EllipseButton: TSpeedButton;
- RoundRectButton: TSpeedButton;
- PenButton: TSpeedButton;
- BrushButton: TSpeedButton;
- PenBar: TPanel;
- BrushBar: TPanel;
- SolidPen: TSpeedButton;
- DashPen: TSpeedButton;
- DotPen: TSpeedButton;
- DashDotPen: TSpeedButton;
- DashDotDotPen: TSpeedButton;
- ClearPen: TSpeedButton;
- PenSize: TEdit;
- // StatusBar1: TStatusBar;
- StatusBar1: TPanel;
- ScrollBox1: TScrollBox;
- Image: TImage;
- SolidBrush: TSpeedButton;
- ClearBrush: TSpeedButton;
- HorizontalBrush: TSpeedButton;
- VerticalBrush: TSpeedButton;
- FDiagonalBrush: TSpeedButton;
- BDiagonalBrush: TSpeedButton;
- CrossBrush: TSpeedButton;
- DiagCrossBrush: TSpeedButton;
- PenColor: TSpeedButton;
- BrushColor: TSpeedButton;
- ColorDialog1: TColorDialog;
- MainMenu1: TMainMenu;
- File1: TMenuItem;
- New1: TMenuItem;
- Open1: TMenuItem;
- Save1: TMenuItem;
- Saveas1: TMenuItem;
- N1: TMenuItem;
- Exit1: TMenuItem;
- Edit1: TMenuItem;
- Cut1: TMenuItem;
- Copy1: TMenuItem;
- Paste1: TMenuItem;
- OpenDialog1: TOpenDialog;
- SaveDialog1: TSaveDialog;
- procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
- Y: Integer);
- procedure LineButtonClick(Sender: TObject);
- procedure RectangleButtonClick(Sender: TObject);
- procedure EllipseButtonClick(Sender: TObject);
- procedure RoundRectButtonClick(Sender: TObject);
- procedure PenButtonClick(Sender: TObject);
- procedure BrushButtonClick(Sender: TObject);
- procedure SetPenStyle(Sender: TObject);
- procedure PenSizeChange(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure SetBrushStyle(Sender: TObject);
- procedure PenColorClick(Sender: TObject);
- procedure BrushColorClick(Sender: TObject);
- procedure Exit1Click(Sender: TObject);
- procedure Open1Click(Sender: TObject);
- procedure Save1Click(Sender: TObject);
- procedure Saveas1Click(Sender: TObject);
- procedure New1Click(Sender: TObject);
- procedure Copy1Click(Sender: TObject);
- procedure Cut1Click(Sender: TObject);
- procedure Paste1Click(Sender: TObject);
- private
- { Private declarations }
- procedure InitializeControls;
- public
- { Public declarations }
- BrushStyle: TBrushStyle;
- PenStyle: TPenStyle;
- PenWide: Integer;
- Drawing: Boolean;
- Origin, MovePt: TPoint;
- DrawingTool: TDrawingTool;
- CurrentFile: string;
- constructor Create(AOwner: TComponent); override;
- procedure SaveStyles;
- procedure RestoreStyles;
- procedure DrawShape(TopLeft, BottomRight: TPoint; AMode: TPenMode);
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses
- BMPDlg
- ;
-
-
- procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- begin
- Drawing := True;
- Image.Canvas.MoveTo(X, Y);
- Origin := Point(X, Y);
- MovePt := Origin;
- // StatusBar1.Panels[0].Text := Format('Origin: (%d, %d)', [X, Y]);
- StatusBar1.Caption := Format('Origin: (%d, %d)', [X, Y]);
- end;
-
- procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- begin
- if Drawing then
- begin
- DrawShape(Origin, Point(X, Y), pmCopy);
- Drawing := False;
- end;
- end;
-
- procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
- Y: Integer);
- begin
- if Drawing then
- begin
- DrawShape(Origin, MovePt, pmNotXor);
- MovePt := Point(X, Y);
- DrawShape(Origin, MovePt, pmNotXor);
- end;
- // StatusBar1.Panels[1].Text := Format('Current: (%d, %d)', [X, Y]);
- StatusBar1.Caption := Format('Current: (%d, %d)', [X, Y]);
- end;
-
- procedure TForm1.LineButtonClick(Sender: TObject);
- begin
- DrawingTool := dtLine;
- end;
-
- procedure TForm1.RectangleButtonClick(Sender: TObject);
- begin
- DrawingTool := dtRectangle;
- end;
-
- procedure TForm1.EllipseButtonClick(Sender: TObject);
- begin
- DrawingTool := dtEllipse;
- end;
-
- procedure TForm1.RoundRectButtonClick(Sender: TObject);
- begin
- DrawingTool := dtRoundRect;
- end;
-
- procedure TForm1.DrawShape(TopLeft, BottomRight: TPoint; AMode: TPenMode);
- begin
- with Image.Canvas do
- begin
- Pen.Mode := AMode;
- case DrawingTool of
- dtLine:
- begin
- Image.Canvas.MoveTo(TopLeft.X, TopLeft.Y);
- Image.Canvas.LineTo(BottomRight.X, BottomRight.Y);
- end;
- dtRectangle: Image.Canvas.Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X,
- BottomRight.Y);
- dtEllipse: Image.Canvas.Ellipse(Topleft.X, TopLeft.Y, BottomRight.X,
- BottomRight.Y);
- dtRoundRect: Image.Canvas.RoundRect(TopLeft.X, TopLeft.Y, BottomRight.X,
- BottomRight.Y, (TopLeft.X - BottomRight.X) div 2,
- (TopLeft.Y - BottomRight.Y) div 2);
- end;
- end;
- end;
-
- procedure TForm1.PenButtonClick(Sender: TObject);
- begin
- // PenBar.Visible := PenButton.Down;
- PenBar.Visible := true;
- end;
-
- procedure TForm1.BrushButtonClick(Sender: TObject);
- begin
- // BrushBar.Visible := BrushButton.Down;
- BrushBar.Visible := True;
- end;
-
- procedure TForm1.SetPenStyle(Sender: TObject);
- begin
- with Image.Canvas.Pen do
- begin
- if Sender = SolidPen then Style := psSolid
- else if Sender = DashPen then Style := psDash
- else if Sender = DotPen then Style := psDot
- else if Sender = DashDotPen then Style := psDashDot
- else if Sender = DashDotDotPen then Style := psDashDotDot
- else if Sender = ClearPen then Style := psClear;
- end;
- end;
-
- procedure TForm1.PenSizeChange(Sender: TObject);
- begin
- // Image.Canvas.Pen.Width := PenWidth.Position;
- Image.Canvas.Pen.Width := StrToInt(PenSize.Text);
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- var
- Bitmap: TBitmap;
- begin
- Bitmap := nil;
- try
- Bitmap := TBitmap.Create;
- Bitmap.Width := 400;
- Bitmap.Height := 400;
- Bitmap.Canvas.Brush.Color := clWhite;
- Bitmap.Canvas.FloodFill(20,20,clBlack,fsBorder);
-
- Image.Picture.Graphic := Bitmap;
- finally
- Bitmap.Free;
- end;
- end;
-
- procedure TForm1.SetBrushStyle(Sender: TObject);
- begin
- TSpeedButton(Sender).Glyph.Canvas.Refresh;
- with Image.Canvas.Brush do
- begin
- if Sender = SolidBrush then Style := bsSolid
- else if Sender = ClearBrush then Style := bsClear
- else if Sender = HorizontalBrush then Style := bsHorizontal
- else if Sender = VerticalBrush then Style := bsVertical
- else if Sender = FDiagonalBrush then Style := bsFDiagonal
- else if Sender = BDiagonalBrush then Style := bsBDiagonal
- else if Sender = CrossBrush then Style := bsCross
- else if Sender = DiagCrossBrush then Style := bsDiagCross;
- end;
- end;
-
- procedure TForm1.PenColorClick(Sender: TObject);
- begin
- ColorDialog1.Color := Image.Canvas.Pen.Color;
- if ColorDialog1.Execute then
- Image.Canvas.Pen.Color := ColorDialog1.Color;
- end;
-
- procedure TForm1.BrushColorClick(Sender: TObject);
- begin
- ColorDialog1.Color := Image.Canvas.Brush.Color;
- if ColorDialog1.Execute then
- Image.Canvas.Brush.Color := ColorDialog1.Color;
- end;
-
- procedure TForm1.Exit1Click(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TForm1.Open1Click(Sender: TObject);
- begin
- if OpenDialog1.Execute then
- begin
- CurrentFile := trim(OpenDialog1.FileName);
- SaveStyles;
- Image.Picture.LoadFromFile(CurrentFile);
- RestoreStyles;
- end;
- end;
-
- procedure TForm1.Save1Click(Sender: TObject);
- begin
- // if CurrentFile <> EmptyStr then
- if CurrentFile <> '' then
- Image.Picture.SaveToFile(CurrentFile)
- else SaveAs1Click(Sender);
- end;
-
- procedure TForm1.Saveas1Click(Sender: TObject);
- begin
- if SaveDialog1.Execute then
- begin
- CurrentFile := trim(SaveDialog1.FileName);
- Save1Click(Sender);
- end;
- end;
-
- procedure TForm1.New1Click(Sender: TObject);
- var
- Bitmap: TBitmap;
- begin
- with NewBMPForm do
- begin
- WidthEdit.Text := IntToStr(Image.Picture.Graphic.Width);
- HeightEdit.Text := IntToStr(Image.Picture.Graphic.Height);
- if ShowModal <> idCancel then
- begin
- Bitmap := nil;
- try
- Bitmap := TBitmap.Create;
- Bitmap.Width := StrToInt(WidthEdit.Text);
- Bitmap.Height := StrToInt(HeightEdit.Text);
- SaveStyles;
- Image.Picture.Graphic := Bitmap;
- RestoreStyles;
- // CurrentFile := EmptyStr;
- CurrentFile := '';
- finally
- Bitmap.Free;
- end;
- ActiveControl := WidthEdit;
- end;
- end;
- end;
-
- procedure TForm1.Copy1Click(Sender: TObject);
- begin
- MessageDlg('Clipboard operations not yet supported',mtInformation, [mbOk], 0);
- // Clipboard.Assign(Image.Picture);
- end;
-
- procedure TForm1.Cut1Click(Sender: TObject);
- var
- ARect: TRect;
- begin
- Copy1Click(Sender);
- with Image.Canvas do
- begin
- CopyMode := cmWhiteness;
- ARect := Rect(0, 0, Image.Width, Image.Height);
- CopyRect(ARect, Image.Canvas, ARect);
- CopyMode := cmSrcCopy;
- end;
- end;
-
- procedure TForm1.Paste1Click(Sender: TObject);
- var
- Bitmap: TBitmap;
- begin
- MessageDlg('Clipboard operations not yet supported',mtInformation, [mbOk], 0);
- (*
- if Clipboard.HasFormat(CF_BITMAP) then
- begin
- Bitmap := TBitmap.Create;
- try
- Bitmap.Assign(Clipboard);
- Image.Canvas.Draw(0, 0, Bitmap);
- finally
- Bitmap.Free;
- end;
- end;
- *)
- end;
-
- procedure TForm1.SaveStyles;
- begin
- with Image.Canvas do
- begin
- BrushStyle := Brush.Style;
- PenStyle := Pen.Style;
- PenWide := Pen.Width;
- end;
- end;
-
- procedure TForm1.RestoreStyles;
- begin
- with Image.Canvas do
- begin
- Brush.Style := BrushStyle;
- Pen.Style := PenStyle;
- Pen.Width := PenWide;
- end;
- end;
-
- constructor TForm1.Create(AOwner: TComponent);
- begin
- inherited;
- InitializeControls;
- end;
- procedure TForm1.InitializeControls;
- begin
- // Initalizing all controls...
- Panel1:= TPanel.Create(Self);
- LineButton:= TSpeedButton.Create(Self);
- RectangleButton:= TSpeedButton.Create(Self);
- EllipseButton:= TSpeedButton.Create(Self);
- RoundRectButton:= TSpeedButton.Create(Self);
- PenButton:= TSpeedButton.Create(Self);
- BrushButton:= TSpeedButton.Create(Self);
- PenBar:= TPanel.Create(Self);
- SolidPen:= TSpeedButton.Create(Self);
- DashPen:= TSpeedButton.Create(Self);
- DotPen:= TSpeedButton.Create(Self);
- DashDotPen:= TSpeedButton.Create(Self);
- DashDotDotPen:= TSpeedButton.Create(Self);
- ClearPen:= TSpeedButton.Create(Self);
- PenColor:= TSpeedButton.Create(Self);
- // PenWidth:= TUpDown.Create(Self);
- PenSize:= TEdit.Create(Self);
- BrushBar:= TPanel.Create(Self);
- SolidBrush:= TSpeedButton.Create(Self);
- ClearBrush:= TSpeedButton.Create(Self);
- HorizontalBrush:= TSpeedButton.Create(Self);
- VerticalBrush:= TSpeedButton.Create(Self);
- FDiagonalBrush:= TSpeedButton.Create(Self);
- BDiagonalBrush:= TSpeedButton.Create(Self);
- CrossBrush:= TSpeedButton.Create(Self);
- DiagCrossBrush:= TSpeedButton.Create(Self);
- BrushColor:= TSpeedButton.Create(Self);
- // StatusBar1:= TStatusBar.Create(Self);
- StatusBar1:= TPanel.Create(Self);
- ScrollBox1:= TScrollBox.Create(Self);
- Image:= TImage.Create(Self);
- ColorDialog1:= TColorDialog.Create(Self);
- MainMenu1:= TMainMenu.Create(Self);
- File1:= TMenuItem.Create(Self);
- New1:= TMenuItem.Create(Self);
- Open1:= TMenuItem.Create(Self);
- Save1:= TMenuItem.Create(Self);
- Saveas1:= TMenuItem.Create(Self);
- N1:= TMenuItem.Create(Self);
- Exit1:= TMenuItem.Create(Self);
- Edit1:= TMenuItem.Create(Self);
- Cut1:= TMenuItem.Create(Self);
- Copy1:= TMenuItem.Create(Self);
- Paste1:= TMenuItem.Create(Self);
- OpenDialog1:= TOpenDialog.Create(Self);
- SaveDialog1:= TSaveDialog.Create(Self);
-
- // Form's PMEs'
- Left:= 243;
- Top:= 114;
- Width:= 435;
- Height:= 300;
- Caption:= 'Form1';
- Color:= clBtnFace;
- Font.Charset:= DEFAULT_CHARSET;
- Font.Color:= clWindowText;
- Font.Height:= -11;
- Font.Name:= 'SmallFonts';
- Font.Style:= [];
- Menu:= MainMenu1;
- Position:= poDefault;
- OnCreate:= FormCreate;
- OnMouseDown:= FormMouseDown;
- OnMouseMove:= FormMouseMove;
- OnMouseUp:= FormMouseUp;
- PixelsPerInch:= 96;
- with Panel1 do
- begin
- Parent:= Self;
- Left:= 0;
- Top:= 0;
- Width:= 427;
- Height:= 41;
- Align:= alTop;
- TabOrder:= 0;
- end;
-
- with LineButton do
- begin
- Parent:= Panel1;
- Left:= 8;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- OnClick:= LineButtonClick;
- Glyph.LoadFromFile('line.bmp');
- // GroupIndex:= 1;
- // Down:= True;
- end;
-
- with RectangleButton do
- begin
- Parent:= Panel1;
- Left:= 40;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('fsolid.bmp');
- // GroupIndex:= 1;
- OnClick:= RectangleButtonClick;
- end;
-
-
- with EllipseButton do
- begin
- Parent:= Panel1;
- Left:= 72;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('ellipse.bmp');
- // GroupIndex:= 1;
- OnClick:= EllipseButtonClick;
- end;
-
- with RoundRectButton do
- begin
- Parent:= Panel1;
- Left:= 104;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('roundrec.bmp');
- // GroupIndex:= 1;
- OnClick:= RoundRectButtonClick;
- end;
-
- with PenButton do
- begin
- Parent:= Panel1;
- Left:= 176;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('pen.bmp');
- // AllowAllUp:= True;
- // GroupIndex:= 2;
- OnClick:= PenButtonClick;
- end;
-
- with BrushButton do
- begin
- Parent:= Panel1;
- Left:= 208;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('brush.bmp');
- // AllowAllUp:= True;
- // GroupIndex:= 3;
- OnClick:= BrushButtonClick;
- end;
-
- with PenBar do
- begin
- Parent:= Self;
- Left:= 0;
- Top:= 41;
- Width:= 427;
- Height:= 41;
- Align:= alTop;
- TabOrder:= 1;
- Visible:= False;
- end;
-
- with SolidPen do
- begin
- Parent:= PenBar;
- Left:= 8;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('solid.bmp');
- // GroupIndex:= 4;
- // Down:= True;
- OnClick:= SetPenStyle;
- end;
-
- with DashPen do
- begin
- Parent:= PenBar;
- Left:= 38;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('dashed.bmp');
- // GroupIndex:= 4;
- OnClick:= SetPenStyle;
- end;
-
- with DotPen do
- begin
- Parent:= PenBar;
- Left:= 68;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('dotted.bmp');
- // GroupIndex:= 4;
- OnClick:= SetPenStyle;
- end;
-
- with DashDotPen do
- begin
- Parent:= PenBar;
- Left:= 98;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('dashdot.bmp');
- // GroupIndex:= 4;
- OnClick:= SetPenStyle;
- end;
-
- with DashDotDotPen do
- begin
- Parent:= PenBar;
- Left:= 128;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('dashdot2.bmp');
- // GroupIndex:= 4;
- OnClick:= SetPenStyle;
- end;
-
- with ClearPen do
- begin
- Parent:= PenBar;
- Left:= 158;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('clear.bmp');
- // GroupIndex:= 4;
- OnClick:= SetPenStyle;
- end;
-
- with PenColor do
- begin
- Parent:= PenBar;
- Left:= 214;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('colors.bmp');
- OnClick:= PenColorClick;
- end;
- (*
- with PenWidth do
- begin
- Parent:= PenBar;
- Left:= 309;
- Top:= 12;
- Width:= 9;
- Height:= 20;
- Associate:= PenSize;
- ArrowKeys:= False;
- Min:= 0;
- Position:= 1;
- TabOrder:= 0;
- Wrap:= False;
- end;
- *)
- with PenSize do
- begin
- Parent:= PenBar;
- Left:= 280;
- Top:= 12;
- Width:= 29;
- Height:= 24;
- TabOrder:= 1;
- Text:= '1';
- OnChange:= PenSizeChange;
- end;
-
- with BrushBar do
- begin
- Parent:= Self;
- Left:= 0;
- Top:= 82;
- Width:= 427;
- Height:= 41;
- Align:= alTop;
- TabOrder:= 2;
- Visible:= False;
- end;
-
- with SolidBrush do
- begin
- Parent:= BrushBar;
- Left:= 8;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('fsolid.bmp');
- // GroupIndex:= 1;
- // Down:= True;
- OnClick:= SetBrushStyle;
- end;
-
- with ClearBrush do
- begin
- Parent:= BrushBar;
- Left:= 40;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('fclear.bmp');
- // GroupIndex:= 1;
- OnClick:= SetBrushStyle;
- end;
-
- with HorizontalBrush do
- begin
- Parent:= BrushBar;
- Left:= 72;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('fhoriz.bmp');
- // GroupIndex:= 1;
- OnClick:= SetBrushStyle;
- end;
-
- with VerticalBrush do
- begin
- Parent:= BrushBar;
- Left:= 104;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('fvert.bmp');
- // GroupIndex:= 1;
- OnClick:= SetBrushStyle;
- end;
-
- with FDiagonalBrush do
- begin
- Parent:= BrushBar;
- Left:= 136;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('fdiag.bmp');
- // GroupIndex:= 1;
- OnClick:= SetBrushStyle;
- end;
-
- with BDiagonalBrush do
- begin
- Parent:= BrushBar;
- Left:= 168;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('bdiag.bmp');
- // GroupIndex:= 1;
- OnClick:= SetBrushStyle;
- end;
-
- with CrossBrush do
- begin
- Parent:= BrushBar;
- Left:= 200;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('cross.bmp');
- // GroupIndex:= 1;
- OnClick:= SetBrushStyle;
- end;
-
- with DiagCrossBrush do
- begin
- Parent:= BrushBar;
- Left:= 232;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('dcross.bmp');
- // GroupIndex:= 1;
- OnClick:= SetBrushStyle;
- end;
-
- with BrushColor do
- begin
- Parent:= BrushBar;
- Left:= 279;
- Top:= 8;
- Width:= 30;
- Height:= 30;
- Glyph.LoadFromFile('colors.bmp');
- OnClick:= BrushColorClick;
- end;
-
- // faux status bar
-
- with StatusBar1 do
- begin
- Parent:= Self;
- Left:= 0;
- // Top:= 236;
- Width:= 427;
- Height:= 18;
- BevelOuter := bvLowered;
- BevelWidth := 2;
- Alignment := taLeftJustify;
- Align := alBottom;
- end;
-
- with ScrollBox1 do
- begin
- Parent:= Self;
- Left:= 0;
- Top:= 123;
- Width:= 427;
- Height:= 113;
- Align:= alClient;
- Color := clGray;
- TabOrder:= 4;
- end;
-
- with Image do
- begin
- Parent:= ScrollBox1;
- Left:= 0;
- Top:= 0;
- Width:= 229;
- Height:= 229;
- AutoSize:= True;
- OnMouseDown:= FormMouseDown;
- OnMouseMove:= FormMouseMove;
- OnMouseUp:= FormMouseUp;
- end;
-
- with ColorDialog1 do
- begin
- Parent:= Self;
- Ctl3D:= True;
- Left:= 377;
- Top:= 148;
- end;
-
- with MainMenu1 do
- begin
- Parent:= Self;
- Left:= 337;
- Top:= 148;
- end;
-
- with File1 do
- begin
- MainMenu1.Items.Add(File1);
- Caption:= '&File';
- end;
-
- with New1 do
- begin
- File1.Add(New1);
- Caption:= '&New';
- OnClick:= New1Click;
- end;
-
- with Open1 do
- begin
- File1.Add(Open1);
- Caption:= '&Open...';
- OnClick:= Open1Click;
- end;
-
- with Save1 do
- begin
- File1.Add(Save1);
- Caption:= '&Save';
- OnClick:= Save1Click;
- end;
-
- with Saveas1 do
- begin
- File1.Add(Saveas1);
- Caption:= 'Save &as...';
- OnClick:= Saveas1Click;
- end;
-
- with N1 do
- begin
- File1.Add(N1);
- Caption:= '-';
- end;
-
- with Exit1 do
- begin
- File1.Add(Exit1);
- Caption:= 'E&xit';
- OnClick:= Exit1Click;
- end;
-
- with Edit1 do
- begin
- MainMenu1.Items.Add(Edit1);
- Caption:= '&Edit';
- end;
-
- with Cut1 do
- begin
- Edit1.Add(Cut1);
- Caption:= 'Cu&t';
- ShortCut:= 16472;
- OnClick:= Cut1Click;
- end;
-
- with Copy1 do
- begin
- Edit1.Add(Copy1);
- Caption:= '&Copy';
- ShortCut:= 16451;
- OnClick:= Copy1Click;
- end;
-
- with Paste1 do
- begin
- Edit1.Add(Paste1);
- Caption:= '&Paste';
- ShortCut:= 16470;
- OnClick:= Paste1Click;
- end;
-
- with OpenDialog1 do
- begin
- Parent := Self;
- DefaultExt:= 'bmp';
- Filter:= 'Bitmaps|(*.bmp)';
- Left := 337;
- Top := 188;
- end;
-
- with SaveDialog1 do
- begin
- Parent:= Self;
- DefaultExt:= 'bmp';
- Filter:= 'Bitmaps|(*.bmp)';
- Left := 377;
- Top:= 188;
- end;
- FormCreate(Self);
- end;
-
- end.
-